﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MainSite.Master" AutoEventWireup="true" CodeBehind="KPIList.aspx.cs" Inherits="BSCMFF.Web.Pages.KPIList" %>
<%@ Register TagPrefix="bsc" TagName="RatingBar" src="~/UserControls/Ratings/RatingBar.ascx"  %>


<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" >
    
    <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" Width="90%"
        AllowSorting="True" AutoGenerateColumns="False" AutoGenerateDeleteColumn="True" 
        AutoGenerateEditColumn="True" DataSourceID="EntityDataSourceKPIs" 
        GridLines="None"   
        onitemdatabound="RadGrid1_ItemDataBound" 
        oninsertcommand="RadGrid1_InsertCommand"
        OnDeleteCommand="RadGrid1_DeleteCommand"
        OnUpdateCommand="RadGrid1_UpdateCommand">
        <MasterTableView DataKeyNames="KPI_ID" DataSourceID="EntityDataSourceKPIs" CommandItemDisplay="Bottom" 
        TableLayout="Fixed" >
            <RowIndicatorColumn>
                <HeaderStyle Width="20px" />
            </RowIndicatorColumn>
            <ExpandCollapseColumn>
                <HeaderStyle Width="20px" />
            </ExpandCollapseColumn>
            <Columns>
                <%--<telerik:GridBoundColumn DataField="KPI_ID" DataType="System.Int32" 
                    HeaderText="KPI_ID" ReadOnly="True" SortExpression="KPI_ID" UniqueName="KPI_ID">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Type_FK" DataType="System.Int32" 
                    HeaderText="Type_FK" SortExpression="Type_FK" UniqueName="Type_FK">
                </telerik:GridBoundColumn>--%>
                <%--<telerik:GridBoundColumn DataField="Strategic_Target_FK" 
                    DataType="System.Int32" HeaderText="Strategic_Target_FK" 
                    SortExpression="Strategic_Target_FK" UniqueName="Strategic_Target_FK">
                </telerik:GridBoundColumn>--%>
                <telerik:GridBoundColumn DataField="Strategic_Target.Name" 
                    DataType="System.String" HeaderText="Strategic Target" 
                    SortExpression="Strategic_Target.Name" UniqueName="Strategic_Target.Name" >
                </telerik:GridBoundColumn>
               <%-- <telerik:GridBoundColumn DataField="Strategic_Target.Description" 
                    DataType="System.String" HeaderText="Strategic Description" 
                    SortExpression="Strategic_Target.Description" UniqueName="Strategic_Target.Description" >
                </telerik:GridBoundColumn>--%>
                <telerik:GridBoundColumn DataField="Name" HeaderText="Name" 
                    SortExpression="Name" UniqueName="Name">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Description" HeaderText="Description" 
                    SortExpression="Description" UniqueName="Description">
                </telerik:GridBoundColumn>
                <%--<telerik:GridBoundColumn DataField="Weight" DataType="System.Int32" 
                    HeaderText="Weight" SortExpression="Weight" UniqueName="Weight">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Start_Value" DataType="System.Int32" 
                    HeaderText="Start_Value" SortExpression="Start_Value" UniqueName="Start_Value">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Current_Value" DataType="System.Int32" 
                    HeaderText="Current_Value" SortExpression="Current_Value" 
                    UniqueName="Current_Value">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Target_Value" DataType="System.Int32" 
                    HeaderText="Target_Value" SortExpression="Target_Value" 
                    UniqueName="Target_Value">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Min" DataType="System.Int32" 
                    HeaderText="Min" SortExpression="Min" UniqueName="Min">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Max" DataType="System.Int32" 
                    HeaderText="Max" SortExpression="Max" UniqueName="Max">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Measure" HeaderText="Measure" 
                    SortExpression="Measure" UniqueName="Measure">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Optimization" HeaderText="Optimization" 
                    SortExpression="Optimization" UniqueName="Optimization">
                </telerik:GridBoundColumn>--%>
                <telerik:GridBoundColumn DataField="Target_Description" 
                    HeaderText="Target_Description" SortExpression="Target_Description" 
                    UniqueName="Target_Description">
                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn >
                    <HeaderTemplate>
                        <asp:Label ID="lablell" runat="server" Text="Priority" ></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                         <bsc:RatingBar ID="RBWeight" runat="server" RBEnabled="false" Value='<%# Convert.ToDouble(Eval("Priority")) %>' />
                    </ItemTemplate>
                    
                </telerik:GridTemplateColumn>
                <telerik:GridRatingColumn DataField="Weight" HeaderText="Weight" SortExpression="Weight"
                        UniqueName="Weight">                    
                </telerik:GridRatingColumn>
            </Columns>
            <%--<EditFormSettings EditFormType="WebUserControl" UserControlName="~/UserControls/Details/KPIDetails.ascx" >
            </EditFormSettings>--%>
        </MasterTableView>
        <HeaderContextMenu EnableAutoScroll="True">
        </HeaderContextMenu>
    </telerik:RadGrid>

</telerik:RadAjaxPanel>

<asp:EntityDataSource ID="EntityDataSourceKPIs" runat="server" 
        ConnectionString="name=BSCEntities" DefaultContainerName="BSCEntities" 
        EnableDelete="True" EnableFlattening="False" EnableInsert="True" 
        EnableUpdate="True" EntitySetName="KPIs" Include="Strategic_Target">
</asp:EntityDataSource>
<asp:EntityDataSource ID="EntityDataSourceStrategic_Targets" runat="server" 
        ConnectionString="name=BSCEntities" DefaultContainerName="BSCEntities" 
        EnableFlattening="False" EntitySetName="Strategic_Target" 
        Select="it.[Name], it.[Description], it.[Strategic_Target_ID]">
</asp:EntityDataSource>
</asp:Content>
